Skip to content

[WIP] observability: add SessionTimer.Reset to re-anchor session start#1607

Merged
paulwe merged 3 commits into
mainfrom
duration_fix
Jun 11, 2026
Merged

[WIP] observability: add SessionTimer.Reset to re-anchor session start#1607
paulwe merged 3 commits into
mainfrom
duration_fix

Conversation

@shishirng

Copy link
Copy Markdown
Contributor

Lets callers re-anchor the timer to the moment a participant actually joins, so wall-clock time accrued before that (auth, room setup, ICE establishment) is not counted toward reported/billed duration. Guards Advance/Reset with a mutex since the re-anchor happens on a different goroutine than the periodic reporter tick. Min-seconds/min-minutes options are preserved across Reset.

Lets callers re-anchor the timer to the moment a participant actually
joins, so wall-clock time accrued before that (auth, room setup, ICE
establishment) is not counted toward reported/billed duration. Guards
Advance/Reset with a mutex since the re-anchor happens on a different
goroutine than the periodic reporter tick. Min-seconds/min-minutes
options are preserved across Reset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 391c7ba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@shishirng shishirng marked this pull request as draft June 5, 2026 10:34
@shishirng shishirng requested a review from paulwe June 5, 2026 10:47
@paulwe paulwe marked this pull request as ready for review June 11, 2026 16:52
@paulwe paulwe merged commit 04a0fe5 into main Jun 11, 2026
3 checks passed
@paulwe paulwe deleted the duration_fix branch June 11, 2026 16:53
paulwe added a commit that referenced this pull request Jun 12, 2026
#1607)

* observability: add SessionTimer.Reset to re-anchor session start

Lets callers re-anchor the timer to the moment a participant actually
joins, so wall-clock time accrued before that (auth, room setup, ICE
establishment) is not counted toward reported/billed duration. Guards
Advance/Reset with a mutex since the re-anchor happens on a different
goroutine than the periodic reporter tick. Min-seconds/min-minutes
options are preserved across Reset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* remove mutex

* generated protobuf

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Paul Wells <paulwe@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants